<template>
  <div class="mian">

    <Rili></Rili>
    <!-- 业务组件 -->
    <Rili2 :list="dateList" @nextMonth="nextMonthHandle" @onChange="onChangeClick" @dayClick="dayHandle"/>

    <div>
      信息展示
      <p>课程名称：{{activeData.name}}</p>
      <p>开始时间：{{activeData.times_start}}</p>
      <p>结束时间：{{activeData.times_end}}</p>
      <p>课程简介：{{activeData.content}}</p>
    </div>
  </div>
</template>

<script setup>
/**
 * admin/年级组长 gg  /admin gg jdzr
 * 一个页面 只有这几个人才能看
 */
import Rili from './components/rili.vue'
import Rili2 from './components/rili2.vue'
import {getRili } from '@/apis/rili'
import { ref } from 'vue'
const dateList = ref([])
const activeData = ref({})
const getRiliHttp = async (from)=>{
  let params = {
    from:from
  }
  const res = await getRili(params)
  
  dateList.value = res.list
  
}
getRiliHttp()

const onChangeClick = (value)=>{
  getRiliHttp(value)
}
const dayHandle = (value) =>{
  activeData.value = {}
  dateList.value.map((item)=>{
    if(item.time == value){
      
      activeData.value = item.data
      console.log(activeData.value,99900)
    }
  })
}
const nextMonthHandle = (value)=>{
  
}
</script>

<style lang="less" scoped>
.main{
  width: 100%;
}
</style>